#!/usr/bin/python
# -*- coding:utf-8 -*-
# @author  : micah
# @time    :  
# @function: 
# @version :


import requests
import multiprocessing


def get_image(url):
    response = requests.get(url).content

    # 拿到网站数据后需要保存到本地
    file_name = url.rsplit('/')[-1]
    save_path = "pic/" + file_name
    with open(save_path, 'wb') as f:
        f.write(response)
        print('下载完成')


url_list = [
    'http://pic.bizhi360.com/bbpic/98/10798.jpg',
    'http://pic.bizhi360.com/bbpic/92/10792.jpg',
    'http://pic.bizhi360.com/bbpic/86/10386.jpg'
]

if __name__ == '__main__':
    for url in url_list:
        t = multiprocessing.Process(target=get_image, args=(url,))
        t.start()
